package com.hecate.user.webapi.controller;

import com.hecate.common.response.HecateResponse;
import com.hecate.user.api.req.role.SaveRoleReq;
import com.hecate.user.dto.role.SaveRoleDTO;
import com.hecate.user.service.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 黄星星
 * @date 2020-07-04
 */
@Api(value = "角色管理模块", tags = { "角色管理操作接口" })
@RestController
@RequestMapping("/userService/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @ApiOperation(value="新增角色",tags={"新增角色"},notes="注意问题点")
    @PostMapping("/saveRole")
    public HecateResponse<SaveRoleDTO> saveDep(@RequestBody SaveRoleReq saveDepReq){
        HecateResponse<SaveRoleDTO> saveDepResponse = roleService.saveRole(saveDepReq);
        return saveDepResponse;
    }
}
